package org.jiuling.gaode.config;

/**
 * 高德配置
 * @author 紫灵
 * @date 2024年08月22日 14时40分03秒
 */
public class GaoDeConfig {

    /** 密钥 */
    private String key;
    /** 需要签名 */
    private boolean needSig = false;

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public boolean isNeedSig() {
        return needSig;
    }

    public void setNeedSig(boolean needSig) {
        this.needSig = needSig;
    }

    /**
     * 建造者
     * @return 建造者
     */
    public static Builder builder() {
        return new Builder();
    }

    /**
     * 建造者
     */
    public static class Builder {
        private final GaoDeConfig gaoDeConfig;
        public Builder() {
            this.gaoDeConfig = new GaoDeConfig();
        }

        public Builder addKey(String key) {
            this.gaoDeConfig.setKey(key);
            return this;
        }

        public Builder addNeedSig(boolean needSig) {
            this.gaoDeConfig.setNeedSig(needSig);
            return this;
        }

        public GaoDeConfig build() {
            return this.gaoDeConfig;
        }

    }
}
